package com.example.demo.common;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.lang.SerializationUtils;

import java.io.Serializable;

public class Test09 {

    public static void main(String[] args) {
        int value = 50;
        func1(value);
        System.out.println(value);

        System.out.println("======================");

        StringBuilder sb = new StringBuilder("test");
        func2(sb);
        System.out.println(sb.toString());

        System.out.println("======================");

        String sbStr = "test";
        func3(sbStr);
        System.out.println(sbStr);
    }

    private static void func1(int value) {
        value = 100;
        System.out.println(value);
    }

    private static void func2(StringBuilder sBuilder) {
        sBuilder.append("aa");
        System.out.println(sBuilder.toString());
    }

    private static void func3(String str) {
        str = "11111";
        System.out.println(str);
    }


    private static class Student implements Serializable, Cloneable {

        public Student(String name) {
            this.name = name;
        }

        private String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        // 重写克隆方法
        @Override
        public Student clone() throws CloneNotSupportedException {
            return (Student) super.clone();
        }
    }
}
